import './assets/main.css'

import { createApp } from 'vue'
import App from './App.vue'

import router from './router/index.js'
import pinia from './store/pinia.js'

import * as ElIcons from '@element-plus/icons-vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'  // main文件中查看下有没有引入
import 'element-plus/theme-chalk/dark/css-vars.css' // 黑暗模式样式

import api from "./utils/http.js"; //封装请求

const app = createApp(App)

app.config.globalProperties.$api = api; //全局挂载 - 请求方法

// 注册el-icon组件
for (let key in ElIcons) {
    app.component(key, ElIcons[key])
  }

app.use(ElementPlus)
app.use(router)
app.use(pinia)

// 挂载
app.mount('#app')
